package com.atguigu.admin.acutuator.endpoint;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author 杨林
 * @create 2023-09-06 17:17 星期三
 * description:
 */
@Component
@Endpoint(id = "myService")
public class MyServiceEndPoint {
    
    @ReadOperation
    public Map getDockerInfo(){
        //端点的读操作
        return Collections.singletonMap("dockerInfo","docker stated");
    }
    
    @WriteOperation
    public void stopDocker(){
        //端点的写操作
        System.out.println("docker stop");
    }
    
}
